code.pdf: code.tex geometry_table.tex binomial_table.tex
	pdflatex code.tex && pdflatex code.tex

geometry_table.tex: ../../code/geometry/tcr.cc adjust_md5_table.py ../../md5_tools/md5_check.sh
	../../md5_tools/md5_check.sh < ../../code/geometry/tcr.cc | ./adjust_md5_table.py > geometry_table.tex

binomial_table.tex: ../../code/binomial/binomial.cc adjust_md5_table.py
	../../md5_tools/md5_check.sh < ../../code/binomial/binomial.cc | ./adjust_md5_table.py > binomial_table.tex

clean:
	rm -f code.pdf
	rm -f code.aux
	rm -f code.log
	rm -f geometry_table.tex
	rm -f binomial_table.tex

new:
	make clean
	make code.pdf
